home *** CD-ROM | disk | FTP | other *** search
- Path: newsfeed.internetmci.com!panix!usenet
- From: gugu@panix.com (gugu)
- Newsgroups: comp.lang.c++
- Subject: re: gnu c/c++ compiler's fstream.h
- Date: 6 Mar 1996 20:46:15 GMT
- Organization: PANIX Public Access Internet and Unix, NYC
- Message-ID: <914.6639T952T978@panix.com>
- NNTP-Posting-Host: gugu.dialup.access.net
- X-Newsreader: THOR 2.22 (Amiga;TCP/IP) *UNREGISTERED*
-
- I've tried to compile the following program to randomly access to read and
- write the file.
-
- File letters.dat contains:
- ABCDEFGHOPQRSTUVWXYZ
-
- --------------------------------------------------------------------------
- #include <fstream.h>
-
- int main(void)
- {
- fstream letters("letters.dat", ios::in | ios::out);
- letters.seekp(8,ios::beg);
-
- for (char letter='I';letter<='Z';letters++)
- letters<<letter;
- letters.seekg(0,ios::beg);
-
- while (!letters.eof())
- cout.put((char)letters.get());
-
- letters.close();
- }
- -----------------------------------------------------------------------------
-
- 77 % g++ random.cc
- random.cc: In function `int main()':
- random.cc:8: no post-increment operator for type
- 78 %
-
- I can't get it to work. What does the error message mean? I am new to C++
- and much help will be sooo much appreciated. Thanks!
-
- gugu@panix.com
-
-